package com.zhipu.resetbalance.ui.home.normal;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProvider;

import com.zhipu.resetbalance.R;
import com.zhipu.resetbalance.databinding.ActivityNormalBalanceBinding;
import com.zhipu.resetbalance.ui.BaseActivity;


/**
 * 普通天平
 */
public class NormalBalanceActivity extends BaseActivity<ActivityNormalBalanceBinding> {


    /**
     * VM
     */
    private NormalBalanceViewModel mNormalBalanceViewModel;

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_normal_balance;
    }



    @Override
    public void initViewModel() {
        super.initViewModel();
        //VM
        mNormalBalanceViewModel = new ViewModelProvider(getViewModelStore(), new ViewModelProvider.AndroidViewModelFactory(getApplication())).get(NormalBalanceViewModel.class);
        binding.setViewModel(mNormalBalanceViewModel);
    }


    @Override
    public void initView() {
        super.initView();
        if(null != mNormalBalanceViewModel){
            mNormalBalanceViewModel.milliseconds();
        }
    }

    @Override
    protected void onDestroy() {
        if(null != mNormalBalanceViewModel){
            mNormalBalanceViewModel.ReleaseTimer();
        }
        super.onDestroy();
    }
}
